package cc.SSM.utils;

/**
 * 生成唯一ID
 * 长度16位
 * 
 */
public class IdGenerator {


	public static Long getBigIntId() {
		Long maxNum = System.currentTimeMillis();
		Long randNum = getRandNum();
		return maxNum * 1000 + randNum;
	}
	
	/**
	    * @Title: getBigIntId15
	    * @Description: 获取15位大整形数据ID号
	    * @return Long    15位长整形
	 */
	public static Long getBigIntId15() {
		Long maxNum = System.currentTimeMillis();
		Long randNum = getRandNum();
		return maxNum * 100 + randNum;
	}
	
	// 获取随机数
	private static Long getRandNum() {
		try {
			Long incrNum = Math.round(Math.random() * 900);
			return incrNum;
		} catch (Exception ex) {
			Long incrNum = Math.round(Math.random() * 900);
			return incrNum;
		}
	}

}
